<?php
namespace Mob \ Model;

use Think \ Model;
use Think \ Hook;
/**浏览模式模型
 * Class InfoModel
 */

require_once ('./Application/Mob/Common/function.php');

class BrowseModel extends Model {
	/**
	 * TaskHall  添加浏览记录
	 * @param $Url   浏览URL
	 * @param $type  浏览类型  0=网页， 1=任务，2=好友，3=其他.
	 * @param $Uid 浏览人员ID  0=没有UID
	 * @param $Serailno  业务流水号
	 * @return 操作结果
	*/

  public function addBrowseLog($Type,$businessId,$ext)
  {
	$data['Serialno']=	getSerialno(); //拼写url数组
	$data['type']=$type;   //拼写浏览类型
	$data['browseUid']=	get_uid();  //拼写where条件
	$data['browseUrl']=U();
	$data['srcSite']=get_client_ip();     //取访问地址IP
	$data['serviceSite']=get_LocalIp();   //服务器IP
	$data['type']=$Type;
	$data['businessId']=$businessId;
	$data['ext']=$ext;
	$this->add($data);


	}
	 /**
	 * QueryBrowse  查询浏览记录
	 * @param $where   查询条件
	 * @return 操作结果
	*/

	public function QueryBrowse($uid,$Type,$businessId)
	{
	$where = array('browseUid'=>$uid,'businessId'=>$businessId,'type'=>$Type);

	return $this->where($where)->field('browseUid,businessId,type')->select();



	}

}